home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PAS_0793 / VGACHARS.PAS < prev    next >
Pascal/Delphi Source File  |  1993-08-01  |  3KB  |  91 lines

  1. {─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
  2. Msg  : 125 of 320
  3. From : Jack Moffitt                        1:124/1301.0         27 Jul 93  18:02
  4. To   : Dustin Nulf
  5. Subj : Remaping a Program's Cha
  6. ────────────────────────────────────────────────────────────────────────────────
  7. DN> >and finally call int 10h.  if you need some source, i can probably whip
  8. DN> >up another unit for you..
  9.  
  10. DN>That would be nice, Jack! :)
  11.  
  12. ok.. here you are
  13.  
  14. ___-------CUT HERE------8<--------------------}
  15.  
  16. unit VGAChars;
  17.  
  18. { VGA Chars v1.0
  19.   Author: Jack Moffitt
  20.   Purpose: Change the default character set to a user defined font.
  21.   Date: 07-26-93
  22.  
  23.   This is unit is donated to the public domain.  Please feel free to
  24.   manipulate this info in any way you see possible without prior permission
  25.   from the author.                                                          }
  26.  
  27.  
  28. interface
  29.  
  30. procedure LoadNewCharSet(SegCharSet, OfsCharSet, Start, Count: word);
  31. procedure ReloadDefaults;
  32.  
  33. implementation
  34.  
  35. uses Crt;
  36.  
  37. { LoadNewCharSet will load a new user defined font given three parameters.
  38.  
  39.   CharSet is a pointer to the new CharSet.
  40.   Start is the ascii value of the starting char to replace.
  41.   Count is the number of chars to replace.                                  }
  42.  
  43. procedure LoadNewCharSet(SegCharSet, OfsCharSet, Start, Count: word);
  44. begin
  45.   asm
  46.     mov ax, SegCharSet    { Initialize the pointer to ES:BP }
  47.     mov es, ax
  48.  
  49.     mov ax, 1100h  { Function 11h; SubFunction 00h }
  50.     mov bx, 1000h  { 16 bytes per character (1 for each line) }
  51.     mov cx, Count  { Set how many characters to replace }
  52.     mov dx, Start  { Specify where to start replacing }
  53.  
  54.     mov bp, OfsCharSet    { Carried over from above, has to be done or else
  55.                             Count and Start will be corrupted! }
  56.  
  57.     int 10h
  58.   end;
  59. end;
  60.  
  61. { ReloadDefaults will restore the normal character font. }
  62.  
  63. procedure ReloadDefaults;
  64. begin
  65.   textmode(co80); { Restore old font }
  66. end;
  67.  
  68. end.
  69.  
  70. ___----------AND AGAIN---------------
  71.  
  72. hope this does what you wanted.. just change the db's in the dummy
  73. procedure and that's all..   i got the idea of the dummy procedure from
  74. the author of SPCFONT.ZIP..  it takes up less of your datasegment
  75. otherwise you'd take almost 4k redifining the whole character set.  Each
  76. set of 16 bytes represents ONE chacter.  each byte is a binary slice of
  77. the char.  i did it like:
  78.  
  79. 255 = FFh = 11111111b  so it's : 11111111
  80.                                  11111111
  81.                                  11111111
  82.                                  11111111
  83.                                  11111111
  84.                                  11111111
  85.                                  11111111
  86.                                  11111111
  87.                                  11111111
  88.                                  11111111
  89.  on down to the 16th byte.  I believe this only works on ega/vga
  90.  computers.  try it out.. you can do some pretty neat tricks.. (just
  91.  like all of nortons utilities!)...